package oa.hleast.xswl.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;

/**
 * @author 00209
 * @desc 营销场类型枚举
 * @email dz@hleast.com
 * @Date 2021/06/22 22:01:45
 */
@ToString
@AllArgsConstructor
public enum MarketingFieldTypeEnum {
    SECKILL(2, "限时购订单"),
    GROUP(3, "拼组团订单"),
    CROWDFUNDING(4, "众筹订单"),
    ;

    @Getter
    private Integer code;
    @Getter
    private String text;

    public static MarketingFieldTypeEnum getValue(Integer code){
        for (MarketingFieldTypeEnum value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
